#ifndef SDK_OHOS_OHOS_VIDEO_SOURCE_ADAPTER_H_
#define SDK_OHOS_OHOS_VIDEO_SOURCE_ADAPTER_H_

#include "media/base/adapted_video_track_source.h"
#include "rtc_base/timestamp_aligner.h"
#include "api/video/video_frame.h"

namespace ohoswebrtc {

class OHOSVideoTrackSourceAdapter : public rtc::AdaptedVideoTrackSource {
 public:
  static rtc::scoped_refptr<OHOSVideoTrackSourceAdapter> Create(bool is_screencast);
  OHOSVideoTrackSourceAdapter();
  OHOSVideoTrackSourceAdapter(bool is_screencast);
  virtual ~OHOSVideoTrackSourceAdapter();
  bool is_screencast() const override;

  /** If it is not set, the default configuration is used which is different depending on video codec */
  absl::optional<bool> needs_denoising() const override;
  
  webrtc::MediaSourceInterface::SourceState state() const override;

  bool remote() const override;

  void OnFrameCaptured(const webrtc::VideoFrame &frame);

  // Called by VideoSource.
  void OnOutputFormatRequest(int width, int height, int fps);

 private:
  bool is_screencast_;
};

}  // namespace webrtc

#endif  